import request from '@/utils/http'
import type { BaseResult, PageResult } from '@/types/axios'
import type {
  SosPhoneItem,
  SosPhoneQuery,
  SosPhoneSaveParam,
  SosPhoneUpdateParam,
  SosPhoneIdParam
} from './model/sosModel'

export class SosPhoneService {
  /**
   * 分页查询一键急救电话
   */
  static getPage(params: SosPhoneQuery) {
    return request.post<BaseResult<PageResult<SosPhoneItem>>>({
      url: '/sosPhone/page',
      params
    })
  }

  /**
   * 新增一键急救电话
   */
  static save(params: SosPhoneSaveParam) {
    return request.post<BaseResult>({
      url: '/sosPhone/save',
      params
    })
  }

  /**
   * 更新一键急救电话
   */
  static update(params: SosPhoneUpdateParam) {
    return request.post<BaseResult>({
      url: '/sosPhone/update',
      params
    })
  }

  /**
   * 删除一键急救电话
   */
  static remove(params: SosPhoneIdParam) {
    return request.post<BaseResult>({
      url: '/sosPhone/delete',
      params
    })
  }

  /**
   * 查询详情
   */
  static detail(params: SosPhoneIdParam) {
    return request.post<BaseResult<SosPhoneItem>>({
      url: '/sosPhone/detail',
      params
    })
  }
}

